﻿#include "TestOrderOperator.h"
#include "Tools.h"


TestOrderOperator::TestOrderOperator(CTPModel &ctpModel)
	: m_ctpModel(ctpModel)
{
}


TestOrderOperator::~TestOrderOperator()
{
}

void TestOrderOperator::SetMoniteSymbol(const std::string &pSymbol)
{
	m_monitorSymbol = pSymbol;
}

void TestOrderOperator::InsertOrder(int volum)
{
	m_ctpModel.InsertOrderNow(m_monitorSymbol, volum, 1, m_lastPrice);
}

void TestOrderOperator::InsertOrder(int volum, int tickCount)
{
	m_ctpModel.InsertOrderNow(m_monitorSymbol, volum, tickCount, m_lastPrice);
}
//
//void TestOrderOperator::OnDealPrice(const std::string &pSymbolName, MData::PriceItem &pItem)
//{
//	if (m_monitorSymbol.compare(pSymbolName) == 0)
//	{
//		m_lastPrice = pItem.LastPrice;
//		emit sigPrice(m_lastPrice);
//	}
//}
//
//void TestOrderOperator::OnDealKItem(const std::string &pSymbolName, MData::KLineItem &pItem)
//{
//	if (m_monitorSymbol.compare(pSymbolName) == 0)
//	{
//		m_lastPrice = pItem.Close;
//		emit sigPrice(m_lastPrice);
//	}
//}
